home *** CD-ROM | disk | FTP | other *** search
- #include "defs.h"
-
- #define CHECKPOINTS 0
- #include "debug.h"
-
- void Begin_copy( void )
- {
- Rect dest, view;
- GrafPtr save_port;
-
- CKPT("Begin_copy start");
- /*
- Since this text isn't actually going to be displayed, it doesn't
- matter much what view and destination rectangles we use.
- */
- dest.top = 10000;
- dest.bottom = 20000;
- dest.left = 0;
- dest.right = 1000;
- view = dest;
- /*
- If we used the front window's port as the TextEdit port, then
- the TEKey and TEInsert calls in My_StdText would cause
- My_StdText to be reentered, and would also mess up the pen
- location. Therefore we create a scratch GrafPort.
- */
- GetPort( &save_port );
- text_port = (GrafPtr) NewPtr( sizeof(GrafPort) );
- if (text_port == NIL)
- return;
- OpenPort( text_port );
- SetEmptyRgn( text_port->visRgn );
- text_h = TEStylNew( &dest, &view );
- SetPort( save_port );
-
- if (front->grafProcs == NIL)
- {
- if ((front->portBits.rowBytes & 0xC000) == 0xC000) // color GrafPort?
- {
- front->grafProcs = (QDProcs *) NewPtr( sizeof(CQDProcs) );
- if (front->grafProcs == NIL)
- return;
- SetStdCProcs( (CQDProcs *)front->grafProcs );
- }
- else
- {
- front->grafProcs = (QDProcs *) NewPtr( sizeof(QDProcs) );
- if (front->grafProcs == NIL)
- return;
- SetStdProcs( front->grafProcs );
- }
- got_grafProcs = true;
- }
- else
- got_grafProcs = false;
- Old_StdText = (pascal void (*)(short, Ptr, Point, Point))
- front->grafProcs->textProc;
- front->grafProcs->textProc = (ProcPtr) My_StdText;
- last_v = 0;
- CKPT("Begin_copy end");
- }
-